import request from '@/utils/request'

// 查询game列表
export function listGame(query) {
  return request({
    url: '/business/game/list',
    method: 'get',
    params: query
  })
}

// 查询game详细
export function getGame(id) {
  return request({
    url: '/business/game/' + id,
    method: 'get'
  })
}

// 新增game
export function addGame(data) {
  return request({
    url: '/business/game',
    method: 'post',
    data: data
  })
}

// 修改game
export function updateGame(data) {
  return request({
    url: '/business/game',
    method: 'put',
    data: data
  })
}

// 删除game
export function delGame(id) {
  return request({
    url: '/business/game/' + id,
    method: 'delete'
  })
}

// 状态修改
export function changeStatus(gameId) {
  return request({
    url: '/business/game/state/' + gameId,
    method: 'get'
  })
}

export function uploadGameResource(data) {
  return request({
    url: '/business/gameResource/uploadGameResource',
    method: 'post',
    data: data
  })
}

export function uploadGame(data) {
  return request({
    url: '/business/game/upload',
    method: 'post',
    data: data
  })
}